<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
    <style>
    .box{
        width: 50px;
        height: 50px;
        border-radius: 50%;
        background-color: green;
        position: absolute;
        left: 0;
    }
    .box :hover{
        /* transform: scale(1.5); */
        width: 100px;
        height: 100px;
    }
    </style>
</head>
<body>
    <div class="box">
    </div>
    <script>
    let dis=0;
    const box = document.querySelector('.box');
    // setInterval(() =>{
    //     box.style.left = ++dis +'px' ;
    // },16);
    function animation() {
        requestAnimationFrame(function(){
            box.style.left = ++dis +'px';
            if(dis<500)
            animation();
        })
    }
    animation();
    </script>
</body>
</html>